home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / dev / gcc / libnixV0_8.lha / gnu / libnix-sources.lha / sources / nix / setjmp / longjmp.c next >
Encoding:
Text File  |  1994-12-12  |  452 b   |  10 lines

  1. asm(".text                  ;" /* doing this in c is very hard */
  2.     ".even                  ;"
  3.     ".globl _longjmp        ;"
  4.     "_longjmp:              ;"
  5.     "  movel  sp@(4),a0     ;" /* get address of jmp_buf */
  6.     "  movel  sp@(8),d0     ;" /* get returncode */
  7.     "  moveml a0@(4),#0xfcfc;" /* restore all registers (including sp) except scratch */
  8.     "  movel  a0@,sp@       ;" /* restore returnaddress */
  9.     "  rts                  ;");
  10.